#pragma once
#include <QMainWindow>
#include <QPlainTextEdit>
#include <QMutex>


////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

class MainWindow : public QWidget {
Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);

    void drawPoint(int, int, Qt::GlobalColor);

    void clearPoint(int, int);

    void drawGrid();
    void initMap(int8_t **,int,int);

protected:
    void paintEvent(QPaintEvent *event);

    void keyPressEvent(QKeyEvent *event);

    void mousePressEvent(QMouseEvent *event);

    void mouseMoveEvent(QMouseEvent *event);

    void timerEvent(QTimerEvent *event);

private:
    QImage *m_img;                     // background image
    int m_canvasW, m_canvasH;       // canvas size
};

